package com.jh.mms.web.listener;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import com.jh.mms.util.Constants;

public class ApplicationListener implements ServletContextListener {

	private ServletContext context;

	public void contextDestroyed(ServletContextEvent e) {

		System.out.println("======= Application Context Destroyed =======");

		context = null;

	}

	public void contextInitialized(ServletContextEvent e) {

		System.out.println("======= Application Context Initialized =======");

		context = e.getServletContext();

		context.setAttribute("ctx", context.getContextPath());
		context.setAttribute(Constants.APPLICATION_NAME, "手机名片系统");

	}

}
